package br.com.ecommerce.controller;

import javax.annotation.PostConstruct;

import org.springframework.stereotype.Controller;

import br.com.ecommerce.domain.entity.Cliente;
import br.com.suricattus.surispring.framework.controller.ControllerSupport;
import br.com.suricattus.surispring.spring.scope.annotation.ViewScoped;

import com.ocpsoft.pretty.faces.annotation.URLAction;
import com.ocpsoft.pretty.faces.annotation.URLMapping;

/**
 * Controladora do cadastro de um novo cliente 
 * 
 * @author marco.nascimento
 * @see Cliente
 */
@ViewScoped
@URLMapping(id = "cadastrarCliente", pattern = "/cliente/cadastro", viewId = "/view/cliente/cadastro/ativar.xhtml")
@Controller("cadastrarClienteController")
public class CadastrarClienteController extends ControllerSupport {
    private static final long serialVersionUID = 1990350005383671979L;
    
    private Cliente cliente;
    
    @PostConstruct
    public void init() {
        cliente = new Cliente();
    }
    
    @URLAction(mappingId = "cadastrarCliente", onPostback = false)
    public void cadastrar() {
        // TODO: Implementar o cadastro de cliente.
    }
    
    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }
}